package cn.wolfcode.domain;

import lombok.Data;

import java.util.List;

@Data
public class Question {
    /** */
    private Long id;

    /** 标题*/
    private String title;

    /** 类型(单选/多选/判断)*/
    private Integer type;

    /** 判断正确(针对判断题才有此项)*/
    private boolean judgeRight;

    private ExamQuestion examQuestion;

    private List<QuestionItem> questionItems;

    public String getRight(){
        if (judgeRight){
            return "对";
        }
        return "错";
    }

    public String getRight2(){
        for (QuestionItem questionItem : questionItems) {
            if (questionItem.getRight()!=null){
                return questionItem.getRight();
            }
        }
        return null;
    }

    public String getRight3(){
        String str = "";
        for (QuestionItem questionItem : questionItems) {
            if (questionItem.getRight()!=null){
                str +=questionItem.getRight();
            }
        }
        return str;
    }

}